# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dbpwaudit
_pkgname=DBPwAudit
pkgver=0.8
pkgrel=7
groups=('blackarch' 'blackarch-cracker' 'blackarch-defensive')
pkgdesc='A Java tool that allows you to perform online audits of password quality for several database engines.'
url='http://www.cqure.net/wp/dbpwaudit/'
license=('GPL')
depends=('java-environment')
arch=('any')
source=("http://www.cqure.net/tools/dbpwaudit_${pkgver//./_}.zip")
sha512sums=('3b6ddfdd736b5547f2ca2b5b8b6a96fe5bab7717c71cd7f7ddb88f9329d214a90200963294a156b45ad2b9baee9f06cd947966ef53a14564924b05c70a7e2eea')

prepare() {
  cd $_pkgname

  sed -i "1a\cd /usr/share/dbpwaudit" *.sh
}

package() {
  cd $_pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp --no-preserve=ownership -r * "$pkgdir/usr/share/$pkgname/"

  install -Dm 755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"

  rm "$pkgdir/usr/share/$pkgname"/*.cmd

  chmod -x "$pkgdir/usr/share/$pkgname"/*.conf
}

